// 模板接口
class Target {
    request () {
        console.log('请求被调用')
    }
}

// 需要适配的类
class Adaptee {
    specificRequest () {
        console.log('方法被访问')
    }
}

// 适配器类， 将adaptee转换为target
class Adapter extends Target {
    constructor(adaptee) {
        super()
        this.adaptee = adaptee
    }
    request () {
        this.adaptee.specificRequest()
    }
}

// 使用适配器将客户端与adaptee解耦
const client = new Adapter(new Adaptee)
client.request()